package com.ruoyi.web.controller.mail;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.mail.MailInfoDTO;
import com.ruoyi.system.service.mail.MailApplication;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: zhengxiong.jiang
 * @createDate: 2023/5/22
 * @version: 1.0
 */
@Api(tags = "邮件发送api")
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/mail" )
public class MailController {

    @Autowired
    private MailApplication mailDemoApplicationTests;

    @PostMapping("/sendMailTest")
    @ApiOperation(value = "发送邮件测试")
    public AjaxResult sendMail(@RequestBody MailInfoDTO mailInfoDTO) {
        mailDemoApplicationTests.sendSimpleMail(mailInfoDTO);
        return AjaxResult.success();
    }

}
